package com.gitee.fsadmin.controller.sys;

import com.gitee.fsadmin.common.resp.Result;
import com.gitee.fsadmin.controller.sys.param.ConfigSettingParam;
import com.gitee.fsadmin.service.sys.SysConfigService;
import org.noear.solon.annotation.Inject;
import org.noear.solon.validation.annotation.Validated;
import org.noear.solon.annotation.Post;

import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Controller;

/**
 * @author 六如
 */
@Controller
@Mapping("sys/config")
public class SysConfigController {

    @Inject
    private SysConfigService sysConfigService;

    /**
     * 保存配置
     *
     * @param param param
     */
    @Post @Mapping("/save")
    public Result<Integer> add(@Validated  ConfigSettingParam param) {
        sysConfigService.save(param.getItems());
        return Result.ok(1);
    }


}
